package p1;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component //这个注解在这里的作用就是说明这个类被Spring接管了,代表该类已经注册到了IOC容器中
public class User {
    @Value("章鱼哥")  //属性注入值
   private String name;
    @Value("男")
    private String xingbie;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getXingbie() {
        return xingbie;
    }

    public void setXingbie(String xingbie) {
        this.xingbie = xingbie;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", xingbie='" + xingbie + '\'' +
                '}';
    }
}
